package kgame5.pbe.atlantic.comp {
	import kgame5.pbe.atlantic.vo.EntityVO;
	import kgame5.pbe.engine.PBE;
	import kgame5.pbe.engine.entity.EntityComponent;

	/**
	 * @author max
	 * 2010-12-11
	 * 持有数据，并向spacialManager和viewManager注册
	 */
	public class DataComp extends EntityComponent{
		
		public static const NAME:String="DataComp";//供向entity注册时使用
		
		public var entVO:EntityVO;
		
		public function DataComp(){
			
		}
		
		override protected function onAdd():void{
			super.onAdd();
			PBE.senseWorld.add(entVO);
			PBE.spacialManager.addSpacialVO(entVO.spcVO);
		}
		override protected function onRemove():void{
			super.onRemove();
			PBE.senseWorld.remove(entVO.id);
			PBE.spacialManager.removeSpacialVO(entVO.spcVO);
		}
		override protected function onReset():void{
			super.onReset();
		}
	}
}
